using System;
using AutoMapper;

namespace CodeCampServerLite.UI.Helpers
{
	public interface IObjectMapper
	{
		TDestination Map<TSource, TDestination>(TSource source);
	}

	public class ObjectMapper : IObjectMapper
	{
		private readonly IMappingEngine _mappingEngine;

		public ObjectMapper(IMappingEngine mappingEngine)
		{
			_mappingEngine = mappingEngine;
		}

		public TDestination Map<TSource, TDestination>(TSource source)
		{
			return _mappingEngine.Map<TSource, TDestination>(source);
		}
	}
}